#ifndef __TINYAMLEXT_INPUT_EVENT_H__
#define __TINYAMLEXT_INPUT_EVENT_H__

/*
 * Copyright (c) 2009 Damien Leroux
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 as published by
 * the Free Software Foundation.
 */

#include <tinyaml.h>

typedef struct _event_t* event_t;

/* 0x6106-EV */
#define EVENT_MAGIC 0x61064556

struct _event_t {
	word_t magic;
	tinyaml_float_t timestamp;
	word_t type;
	word_t code;
	struct _data_stack_entry_t value;
};

event_t event_new();

void event_set_timestamp(event_t, tinyaml_float_t);
void event_set_type(event_t, word_t);
void event_set_code(event_t, word_t);
void event_set_value(event_t, vm_data_t);

tinyaml_float_t event_get_timestamp(event_t);
word_t event_get_type(event_t);
word_t event_get_code(event_t);
vm_data_t event_get_value(event_t);

#endif

